import { createRouter, createWebHistory } from 'vue-router'
import LoginView from "../views/login/index.vue"
import HomeView from "../views/home/index.vue"

const routes = [
  {
    path:"/",
    name: 'index',
    redirect:"/login"
  },
  {
    path:"/login",
    name: 'login',
    component: LoginView
  },
  {
    path:"/home",
    name: 'home',
    component: HomeView,
    children:[
      
    ]
  }
];

const router = createRouter({
  // vite里面通过import.meta.env来使用环境变量 https://cn.vitejs.dev/guide/env-and-mode.html
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router;